﻿using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace XLZF.MicroServices.AuthenticationCenter.IdentityUserStore;

public class IdentityUser
{
    [Key]
    [Required]
    public string SubjectId { get; set; }

    [Required]
    public string Username { get; set; }

    [Required]
    public string Password { get; set; }

    public string ProviderName { get; set; }

    public string ProviderSubjectId { get; set; }

    public bool IsActive { get; set; }

    public ICollection<IdentityUserClaim> IdentityUserClaims { get; set; }

}

public class IdentityUserClaim
{
    [Key]
    public string ClaimId { get; set; }

    [Required]
    public string Name { get; set; }

    [Required]
    public string Value { get; set; }

    [Required]
    public string UserSubjectId { get; set; }

    [ForeignKey("UserSubjectId")]
    public virtual IdentityUser IdentityUser { get; set; }

}
